<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:a4j="http://richfaces.org/a4j"
	template="/pages/templates/templateMain.xhtml">

	<ui:param name="browser_tab_title" value="Summary" />
	<ui:param name="page_title" value="Customer editing summary" />

	<ui:define name="content">

		<h:form id="summaryForm">
			<p:panel toggleable="true">
				<f:facet name="header">
					<h:outputText value="General info" />
				</f:facet>
				<h:panelGrid columns="2" columnClasses="column" cellpadding="5"
					width="180">
					<h:outputText value="First Name: " />
					<h:outputText value="#{customer.firstName}"
						style="font-weight:bold" />

					<h:outputText value="Last Name: " />
					<h:outputText value="#{customer.lastName}" style="font-weight:bold" />

					<h:outputText value="Birth Date: " />
					<h:outputText value="#{customer.birthDate}"
						style="font-weight:bold" />

					<h:outputText value="Gender: " />
					<h:outputText value="#{customer.gender}" style="font-weight:bold" />

					<h:outputText value="PIN: " />
					<h:outputText value="#{customer.pin}" style="font-weight:bold" />
				</h:panelGrid>
			</p:panel>
			<br />
			<c:if test="#{address.country != null}">
				<p:panel toggleable="true">
					<f:facet name="header">
						<h:outputText value="Address info" />
					</f:facet>
					<h:panelGrid columns="2" columnClasses="column" cellpadding="5">

						<h:outputText value="Country: " />
						<h:outputText value="#{address.country}" style="font-weight:bold" />

						<h:outputText value="City: " />
						<h:outputText value="#{address.city}" style="font-weight:bold" />

						<h:outputText value="Street: " />
						<h:outputText value="#{address.street}" style="font-weight:bold" />

						<h:outputText value="Street Number: " />
						<h:outputText value="#{address.streetNumber}"
							style="font-weight:bold" />

						<c:if test="#{address.additionalInfo != null}">
							<h:outputText value="Additional info: " />
							<h:outputText value="#{address.additionalInfo}"
								style="font-weight:bold" />
						</c:if>
					</h:panelGrid>
				</p:panel>
			</c:if>
			<br />
			<c:if test="#{customer.gateways != null}">

				<ui:repeat var="gateway" value="#{customer.gateways}">
					<p:panel>
						<f:facet name="header">
							<h:outputText value="Gateway nr. #{gateway.id}" />
						</f:facet>
						<h:outputText value="Gateway Address: " />
						<br />
						<h:outputText
							value="#{gateway.address.country} #{gateway.address.city} #{gateway.address.street} #{gateway.address.streetNumber}"
							style="font-weight:bold" />
					</p:panel>
				</ui:repeat>
			</c:if>
			<br />
			<p:commandButton value="Cancel" action="cancel" immediate="true"
				ajax="false" />
			<p:commandButton value="Done" action="done" ajax="false" />
		</h:form>

	</ui:define>
</ui:composition>